// 获取请求接口
import { request } from "../utils/request.js"

// 向请求接口传入请求类型、路径、请求数据
export default {
    // 获取页面数据请求
    projectionHall: async ({ curPage, eachPage}) => await request({
        type: "GET",
        url: "/api/projectionHall",
        data: { curPage, eachPage},
    }),
    // 添加放映厅请求
    add: async ({ name,status,cinemasId }) => await request({
        type: "POST",
        url: "/api/projectionHall/add",
        data: { name,status,cinemasId },
    }),
    // 获取一个放映厅请求
    getOne: async _id => await request({
        type: "GET",
        url: `/api/projectionHall/getone/${_id}`,
    }),
    // 删除放映厅请求
    del:async _id => await request({
        type: "DELETE",
        url: `/api/projectionHall/del/${_id}`,
    }),
    // 修改数据请求
    reset:async ({ Name,status,cinemasId,_id})=>await request({
        type: "PATCH",
        url: `/api/projectionHall/reset`,
        data:{ Name,status,cinemasId,_id}
    }),
    // 获取下拉列表电影院对应放映厅
    getTheater: async cinemasId => await request({
        type: "GET",
        url: `/api/projectionHall/gettheater/${cinemasId}`,
    }),
    // 查询放映厅
    find: ({cinemaId,status,_id}) => request({
        type: "GET",
        url: `/api/projectionHall/find`,
        data:{cinemaId,status,_id},
    }),
}